<template>
  <div class="wrapper bg_wrapper">
    <div class="mindWidth">
      <div class="footerLink">
        <div class="companyProfile">
          <div>
            <a @click="jumpPage">关于我们</a>
          </div>
          <div @click="handleClick">
            <a href="#">功能介绍</a>
          </div>
        </div>
        <div class="friendship">
          <div class="title changeHanld">友情链接</div>
          <ul>
            <li class="changeHanld" v-for="(item,index) in friendLinkeds" :key="index">
              <a :href="item.link" target="_blank">{{ item.name }}</a>
            </li>
          </ul>
        </div>
        <div class="contact">
          <div class="title changeHanld">联系我们</div>
          <ul>
            <li>咨询热线：{{ contact }}</li>
            <li>地址 ：{{ address }}</li>
          </ul>
        </div>
        <div class="erweima">
          <span>关注微信，查询更方便</span>
          <img :src="imgBaseUrl + codeImg" />
        </div>
        <div class="copyright">
          <a href="https://beian.miit.gov.cn/" target="_blank" class>
            &copy; 2015 – 2021 广州达盟信息科技有限公司 版权所有
            粤ICP备16027894号
          </a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { home, commonRequest, getDomainConfig } from "../api/api.js"; // 数据请求接口
import { imgBaseUrl } from "../api/api.js";
export default {
  name: "footerNav",
  data() {
    return {
      address: "",
      contact: "",
      friendLinkeds: [],
      codeImg: "",
      imgBaseUrl: imgBaseUrl
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    handleClick() {
      window.open("/introduce", "_blank");
    },
    jumpPage() {
      window.open("/aboutUs", "_blank");
    },
    init() {
      commonRequest("/api/sys/depart/getSubInfo", {}).then(res => {
        this.address = res.result.address;
        this.contact = res.result.mobile;
      });
      commonRequest("/api/home/friendlyLinksInfo", {}).then(res => {
        this.friendLinkeds = res;
      });
      getDomainConfig({ configKey: "HOME_PAGE_WE_CHAT_QR_CODE" }).then(res => {
        this.codeImg = res.result.configValue;
      });
    }
  }
};
</script>

<style lang="less" scoped>
.bg_wrapper {
  max-width: 1920px;
  height: 270px;
  margin: 0 auto;
  background-color: #124695;
  // background: url("../assets/footerbg.png") repeat;
  // background-size: cover;
  // background-position: fixed;
}

.footerLink {
  position: relative;
  padding-top: 20px;
  height: 240px;
  color: #fff;
  display: flex;
  justify-content: space-between;

  .companyProfile {
    height: 60px;
    flex: 0.4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    a {
      font-size: 16px;
      cursor: pointer;
    }
  }

  .title {
    font-size: 16px;
  }

  .friendship {
    flex: 1;
    margin-left: 70px;

    ul {
      margin-top: 30px;
      height: 70px;
      display: flex;
      width: 100%;
      flex-wrap: wrap;

      li {
        width: 33.3%;
        display: flex;
        font-size: 13px;
        color: #c1c1c1;

        a {
          font-size: 13px;
        }
      }
    }
  }

  .contact {
    flex: 1;
    margin-left: 70px;
    font-size: 14px;

    ul {
      margin-top: 20px;
      height: 70px;
      display: flex;
      flex-direction: column;
      color: #c1c1c1;
      justify-content: space-around;

      li {
        font-size: 12px;
      }
    }
  }

  .erweima {
    flex: 1;
    display: flex;
    justify-items: center;
    align-items: center;
    flex-direction: column;
    margin-left: 70px;

    img {
      display: block;
      height: 80%;
    }

    span {
      margin-bottom: 20px;
      font-size: 16px;
      margin-left: -16px;
    }
  }

  .copyright {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, -50%);

    a {
      font-size: 14px;
      color: #c1c1c1;
    }
  }
}
</style>
